package com.xiyu.service.convert.office;

import com.xiyu.service.vo.office.space.SpaceGetGroupTypeInfoOutput;
import com.xiyu.service.vo.office.space.SpaceSingleGetOutput;
import com.xiyu.service.model.office.space.OfficeSpaceWorker;
import com.xiyu.service.vo.office.space.SpaceUpdateInput;
import com.xiyu.service.vo.office.space.SpaceCreateInput;
import com.xiyu.service.vo.office.space.SpacePageQueryOutput;
import com.xiyu.service.model.office.space.OfficeSpace;

import java.math.BigDecimal;
import java.util.*;

import org.babyfish.jimmer.sql.ast.tuple.Tuple5;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 办公用房管理 Convert
 */
@Mapper
public interface SpaceConvert {
    SpaceConvert INSTANCE = Mappers.getMapper(SpaceConvert.class);


    List<SpacePageQueryOutput> pageQueryOutputConvert(List<OfficeSpace> output);

    OfficeSpace createInputConvert(SpaceCreateInput input);

    OfficeSpace updateInputConvert(SpaceUpdateInput input);

    OfficeSpaceWorker updateInputConvert(SpaceUpdateInput.spaceWorker input);

    SpaceSingleGetOutput singleGetOutputConvert(OfficeSpace output);

    List<SpaceGetGroupTypeInfoOutput> getGroupTypeInfoOutputConvert(List<Tuple5<Integer, Long, BigDecimal, Long, BigDecimal>> output);

    @Mapping(source = "_1", target = "type")
    @Mapping(source = "_2", target = "count")
    @Mapping(source = "_3", target = "area")
    @Mapping(source = "_4", target = "emptyCount")
    @Mapping(source = "_5", target = "emptyArea")
    SpaceGetGroupTypeInfoOutput getGroupTypeInfoOutputConvert(Tuple5<Integer, Long, BigDecimal, Long, BigDecimal> output);

}
